
Rem
	Strip whitespace (or other characters) from the beginning of a string.
	
	@author	Nicholas Grant
	@updatedby	
	
	@param	string	str
	@param	string	charlist = ""
	
	@variable	string[]	excludedCharlistSplits
	@variable	integer	notExcludedCharCount
	@variable	integer	cnt
	@variable	integer	stringStartPosition
	
	@return	string
EndRem
Function ltrim:String( str:String, charlist:String = "" )
	
	Local excludedCharlistSplits:String[];
	Local notExcludedCharCount:Int = 0;
	Local cnt:Int = 0;
	Local cnt2:Int = 0; '@logical_fix Initialize once (instead of multiple times in for loop)
	Local stringStartPosition:Int = 0;
	
	If ( charlist = "" )
		charlist = " ~t~n~r~0" + Chr(11);
	End If
	
	excludedCharlistSplits = str_split( charlist );
	
	While ( cnt < str.Length - 1 )
		
		For cnt2 = 0  To excludedCharlistSplits.Length - 1
			
			If ( str[cnt..cnt+1][0] = excludedCharlistSplits[cnt2][0] )
				stringStartPosition :+ 1;
			Else
				notExcludedCharCount :+ 1;
			End If
			
		Next
		
		cnt :+ 1;
		If ( notExcludedCharCount = excludedCharlistSplits.Length )
			cnt = str.Length;
		End If
		notExcludedCharCount = 0;
		
	Wend
	
	str = str[stringStartPosition..str.Length];
	
	Return str;
End Function